<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>

<form:form commandName="demoStudent" cssClass="form-horizontal" role="form">
    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="sno">学号</label>
        <div class="col-sm-3">
            <input type="text" name="sno" id="sno" placeholder="学号" value="${demoStudent.sno }"
                   class="form-control required">
        </div>
        <label class="col-sm-2 control-label no-padding-right" for="name">姓名</label>
        <div class="col-sm-3">
            <input type="text" name="name" id="name" placeholder="姓名" value="${demoStudent.name }"
                   class="form-control required">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="gender">性别</label>
        <div class="col-sm-3">
            <form:select path="gender" items="${redis:getDictList('Gender',false)}" itemValue="basId" itemLabel="name" cssClass="form-control"></form:select>
        </div>
        <label class="col-sm-2 control-label no-padding-right" for="birthday">生日</label>
        <div class="col-sm-3">
            <div class="input-group">
                <input type="text" name="birthday" id="birthday" class="form-control date-picker required" readonly
                       value="${demoStudent.birthday }"/>
                <span class="input-group-addon">
                    <i class="fa fa-calendar bigger-110"></i>
                </span>
            </div>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="demo">备注</label>
        <div class="col-sm-8">
            <textarea class="form-control" rows="3" name="demo" id="demo">${demoStudent.demo }</textarea>
        </div>
    </div>
    <form:hidden path="sysId"/>
</form:form>
<script type="text/javascript">
    jQuery(function ($) {
        $('.date-picker').datepicker({
            inline: true,
            format: "yyyy-mm-dd",
            autoclose: true,
            todayHighlight: true,
            language: 'cn'
        })
        //show datepicker when clicking on the icon
            .next().on(ace.click_event, function () {
            $(this).prev().focus();
        });
    });
</script>
